CREATE TABLE [dbo].[TTUNID_MEDI]
(
[CO_UNME] [dbo].[TD_VC_003] NOT NULL,
[DE_UNME] [dbo].[TD_VC_010] NOT NULL,
[DE_SIMB] [dbo].[TD_VC_003] NULL,
[CO_UNSU] [dbo].[TD_VC_002] NULL,
[CO_UNME_SUNA] [dbo].[TD_VC_002] NULL,
[DE_OTRO_SUNA] [dbo].[TD_VC_020] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTUNID_ME__CO_US__48EFCE0F] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTUNID_ME__FE_US__49E3F248] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTUNID_ME__CO_US__4AD81681] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTUNID_ME__FE_US__4BCC3ABA] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTUNID_MEDI] ADD CONSTRAINT [PK__TTUNID_M__E441FAC417E28260] PRIMARY KEY CLUSTERED  ([CO_UNME]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTUNID_MEDI] ADD CONSTRAINT [FK__TTUNID_ME__CO_UN__5B988E2F] FOREIGN KEY ([CO_UNME_SUNA]) REFERENCES [dbo].[TTUNME_SUNA] ([CO_UNME_SUNA])
GO
GRANT SELECT ON  [dbo].[TTUNID_MEDI] TO [public]
GRANT INSERT ON  [dbo].[TTUNID_MEDI] TO [public]
GRANT DELETE ON  [dbo].[TTUNID_MEDI] TO [public]
GRANT UPDATE ON  [dbo].[TTUNID_MEDI] TO [public]
GO
